import type StageRepayment from "./stageRepayment";

class Repayment {
    /**
     * 还款id
     */
    repaymentId: number | null = null;

    /** 
     * 还款规则 0 一次性还款 1 等额分期 2分期还款
     */
    ruleType: number | null = null;

    /**
     * 还款规则名称
     */
    ruleName: string | null = null; // 注意：原始代码中是 Integer 类型，这里改为 string 更符合规则名称的语义

    /**
     * 本金占比
     */
    principalRatio: number | null = null;

    /**
     * 利息占比
     */
    interestRatio: number | null = null;

    /**
     * 滞纳金占比
     */
    lateFeeRatio: number | null = null;

    /**
     * 违约金占比
     */
    damageRatio: number | null = null;

    /**
     * 罚息占比
     */
    defaultInterestRatio: number | null = null;

    /**
     * 其他金额占比
     */
    otherAmountsRatio: number | null = null;

    /**
     * 还款时间 (注意：这里在原Java代码中是 BigDecimal 类型，可能需要根据实际情况调整)
     */
    repaymentTime: number | null = null;

    /**
     * 分期次数(当且仅当还款类型为1时拥有)
     */
    numberOfInstallments: number | null = null;

    /**
     * 手续费(当且仅当还款类型为1时拥有)
     */
    commission: number | null = null;

    /**
     * 所属的机构id
     */
    applicationInstitutionId: number | null = null;

    /**
     * 创建时间
     */
    createdTime: string | null = null;

    /**
     * 还款方案被使用的数目
     */
    useNumber: number | null = null;
    stageRepayments:Array<StageRepayment>=[];
    constructor(repaymentId?: number, ruleType?: number, ruleName?: string,
                principalRatio?: number, interestRatio?: number, lateFeeRatio?: number,
                damageRatio?: number, defaultInterestRatio?: number, otherAmountsRatio?: number,
                repaymentTime?: number, numberOfInstallments?: number, commission?: number,
                applicationInstitutionId?: number, createdTime?: string, useNumber?: number) {
        this.repaymentId = repaymentId ?? null;
        this.ruleType = ruleType ?? null;
        this.ruleName = ruleName ?? null;
        this.principalRatio = principalRatio ?? null;
        this.interestRatio = interestRatio ?? null;
        this.lateFeeRatio = lateFeeRatio ?? null;
        this.damageRatio = damageRatio ?? null;
        this.defaultInterestRatio = defaultInterestRatio ?? null;
        this.otherAmountsRatio = otherAmountsRatio ?? null;
        this.repaymentTime = repaymentTime ?? null;
        this.numberOfInstallments = numberOfInstallments ?? null;
        this.commission = commission ?? null;
        this.applicationInstitutionId = applicationInstitutionId ?? null;
        this.createdTime = createdTime ?? null;
        this.useNumber = useNumber ?? null;
    }
}
export default Repayment;

/**
 * 还款方案
 */